/**
	This file is part of MemoryTrace.

	MemoryTrace is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

        Written by Ameziane NAIT ABDELAZIZ.
        
	MemoryTrace is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with MemoryTrace.  If not, see <http://www.gnu.org/licenses/>.
**/

/* 
 * File:   Transformer.cpp
 * Author: maxds
 * 
 * Created on 10 août 2011, 17:54
 */

#include "Transformer.h"

int Transformer::startTransformerProgramme(int argc,char** argv,ILogger * transformer)
{
  if(argc!=2){
      printf("Usage: ./xmltransformer [memoryTrace.bsf]\n");
      return  EXIT_SUCCESS;
  }
  
  string trace_in = string(argv[1]);
  
  printf("Le fichier de trace binaire est : %s\n",trace_in.c_str());
  /*Un transformer XML*/
  BinaryReader* reader  = new BinaryReader(trace_in,transformer);
  
  /*On demande au reader de lire le fichier binaire et de generer un fichier xml*/ 
  reader->transforme();
  delete reader;  
}